# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=paros
pkgver=3.2.13
pkgrel=9
groups=('blackarch' 'blackarch-webapp')
pkgdesc='Java-based HTTP/HTTPS proxy for assessing web app vulnerabilities. Supports editing/viewing HTTP messages on-the-fly, spiders, client certificates, proxy-chaining, intelligent scanning for XSS and SQLi, etc.'
arch=('any')
url='http://www.parosproxy.org'
license=('GPL2')
depends=('java-environment')
source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver-unix.zip")
sha512sums=('1072937b2691174cc07b680d4a63a15feee68672840d755b25543aa8e69b80478910f7eec6eedec590394287a841d091f73cda1a834a5123f1fe0453d9053429')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"
  install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"

  # Removing the users guide as we dont have a link for it
  #install -m644 paros_user_guide.pdf "$pkgdir/usr/share/doc/paros"

  install -m 644 release.txt "$pkgdir/usr/share/doc/$pkgname/"
  cp -pR * "$pkgdir/usr/share/$pkgname/"
  cp -p $pkgdir/usr/share/paros/license/* "$pkgdir/usr/share/licenses/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec \$JAVA_HOME/bin/java -jar '/usr/share/$pkgname/$pkgname.jar' "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

